# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=folks
pkgver=0.14
pkgrel=5
pkgdesc="Library to aggregates people into metacontacts"
arch=(x86_64)
url="https://wiki.gnome.org/Projects/Folks"
license=(LGPL2.1)
depends=(libgee libxml2 evolution-data-server)
makedepends=(gobject-introspection gtk-doc vala git meson python-dbusmock)
provides=(libfolks.so libfolks-{dummy,eds}.so)
_commit=58ff25aebfdcda5ba75758444b852f42273f4d1a  # tags/0.14^0
source=("git+https://gitlab.gnome.org/GNOME/folks.git#commit=$_commit"
        0001-eds-add-persona-Test-fails-when-eds-is-compiled-with.patch)
sha256sums=('SKIP'
            'd4bfa9723a42f1417f17452025561af2d77b570fca448e155c05ea8c9d8cb1db')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  git apply -3 ../0001-eds-add-persona-Test-fails-when-eds-is-compiled-with.patch
}

build() {
  local meson_args=(
    -D b_lto=false  # LTO copies some GType constructors
    -D docs=true
    -D telepathy_backend=false
  )
  arch-meson $pkgname build "${meson_args[@]}"
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs -t 4
}

package() {
  DESTDIR="$pkgdir" meson install -C build
}

# vim:set sw=2 et:
